import '../../../models/data_model/HyWorkModel.dart';
import '../../../new_paltform/define/hy_header.dart';

class HyProjectSettingLogicBinding extends Bindings {
  @override
  void dependencies() {
    Get.lazyPut<HyProjectSettingLogic>(() => HyProjectSettingLogic());
  }
}

class HyProjectSettingLogic extends HYBasePageController {
  RxList<ItemModel> items = <ItemModel>[].obs;
  RxList<ItemModel> selectList = <ItemModel>[].obs;
  RxList<ItemModel> unselectList = <ItemModel>[].obs;

  List<ItemModel> get all => [...selectList, ...unselectList];

  @override
  void onInit() {
    if (Get.arguments is List<ItemModel>) {
      items.value = Get.arguments as List<ItemModel>;
    }
    selectList.value =
        items.value.where((element) => element.isDisplay).toList();
    unselectList.value =
        items.value.where((element) => !element.isDisplay).toList();
    super.onInit();
  }

  @override
  void onLoadingRequest() {
    showData(null);
  }
}
